The program was written for Windows 8 using DirectX 11 and Visual Studio 2012.
It might break on Windows 7 as it uses some DirectX 11.1 features, but it hasn't been tested yet.

Run the program in Debug mode to see debug text in Visual Studio's output window.

== CONTROLS ==
W, S, A, D		move the camera
- and =			change the shutter speed
[ and ]			change the film speed
; and '			change the focal length of the lens

Up and Down arrows		change the focal distance of the lens
Left and Right arrows	change the aperture size

Enter	toggle UI display
Space	begin/end capture of long exposure image

O		load an fbx scene
L		load a lens preset

Debug views
1		unprocessed
2		depth map
3		circle of confusion radius
4		old defocus blur algorithm
5		foreground defocus blur
6		background defocus blur
7		velocity map
8		last recorded long exposure image
9, 0	default (full render)

== 3D AND MATH NOTES ==
1 unit distance = 1 meter

DirectXMath uses row-major matrices

They are transposed into column-major matrices when stored in the constant buffers
because that's what the shaders use by default (for faster multiplications)
NOTE: this could be changed by making the shaders use row-major layout instead

Coordinate system is left-handed so that +Z is forward (like old DirectX and the Unity game engine; this also matches clip space)

By default, Counter-clockwise triangles are culled.

== CAMERA NOTES ==
All length measurements are in meters
Camera measurements are 35mm equivalent values

== COLOR AND LIGHTING NOTES ==
sRGB primaries match BT.709 primaries
(http://en.wikipedia.org/wiki/SRGB)

Representative wavelengths for sRGB
(http://mintaka.sdsu.edu/GF/explain/optics/rendering.html for converted values)
(mentioned in Lee et al 2010 - Real-time lens blur effects and focus control)
  610nm Red
  550nm Green
  465nm Blue
  
CIE RGB standard observer wavelengths
(http://www.cis.rit.edu/mcsl/research/1931.php)
  700nm Red
  545nm Green
  435nm Blue

Relative luminance for sRGB (linear gamma)
(http://en.wikipedia.org/wiki/Luminance_%28relative%29)
Y = 0.2126 R + 0.7152 G + 0.0722 B

Chart of illuminance values
(http://en.wikipedia.org/wiki/Lux)

Luminosity functions
(http://en.wikipedia.org/wiki/Luminosity_function)
(http://www.cvrl.org/lumindex.htm)

== SHADER NOTES ==
Most shader calculations should be in view or image space to avoid this issue:
http://www.arcsynthesis.org/gltut/Positioning/Tut07%20The%20Perils%20of%20World%20Space.html

== MISCELLANEOUS NOTES ==
wchar_t strings are UTF-16 strings
char strings should be treated as UTF-8 strings

== POTENTIAL IMPROVEMENTS ==
Only one bokeh texture is loaded; as bokeh shape changes with aperture size, there should be a texture for each relative aperture (ideally, there would be a subsystem that takes 3d models of the iris blades and renders a physically accurate bokeh shape at runtime).

Only the first set of vignetting parameters from each lens preset is used; the model should pick and blend between different sets depending on the current aperture size.

The response curve for the film is currently hardcoded, it should be loaded from a file like the lens parameters.

Film grain is applied in the final tonemapping step; it could be done before the long exposure pass to see the effect there.

The fbx importer needs to handle importing of materials, importing of textures, and linking the different node types and layers together to import them into the renderer's format.